﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<BK.Model.ViewModels.UsersListViewModel>" %>

<%@ Import Namespace="BK.Web.UI.AppCode" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<h2>
		Користувачі</h2>
	<div class="pager">
		<%= Html.PageLinks(Model.PagingInfo,
					x => Url.Action("Index", new { page = x }))%></div>
	<table>
		<tr>
			<th>
				Номер
			</th>
			<th>
				Електрона пошта
			</th>
			<th>
				Імя
			</th>
			<th>
				Прізвище
			</th>
			<th>
				Пароль
			</th>
			<th>
			</th>
		</tr>
		<% foreach (var item in Model.Users)
	 { %>
		<tr>
			<td>
				<%: item.Id %>
			</td>
			<td>
				<%: item.Email %>
			</td>
			<td>
				<%: item.FirstName %>
			</td>
			<td>
				<%: item.LastName %>
			</td>
			<td>
				<%: item.Password %>
			</td>
			<td>
				<%: Html.ActionLink("Edit", "Edit", new { id=item.Id }) %>
				|
				<%: Html.ActionLink("Details", "Details", new { id=item.Id })%>
				|
				<%: Html.ActionLink("Delete", "Delete", new { id=item.Id })%>
			</td>
		</tr>
		<% } %>
	</table>
	<div class="pager">
		<%= Html.PageLinks(Model.PagingInfo,
					x => Url.Action("Index", new { page = x }))%></div>
	<p>
		<%: Html.ActionLink("Create New", "Create") %>
	</p>
</asp:Content>